package com.demo.service.impl;

import com.demo.dao.RoomDAO;
import com.demo.dao.impl.RoomDAOImpl;
import com.demo.service.RoomService;
import com.demo.vo.Room;

import java.io.Serializable;
import java.util.Map;

/**
 * 客房模块的Service层（业务层）的具体实现类，对RoomService接口中定义的抽象方法作出具体的功能实现
 */
public class RoomServiceImpl implements RoomService {
    //@Override
    public void add(Room vo) {
        RoomDAO roomDAO = new RoomDAOImpl();
        roomDAO.add(vo);
    }

    //@Override
    public void delete(long id) {
        RoomDAO roomDAO = new RoomDAOImpl();
        roomDAO.delete(id);
    }

    //@Override
    public void update(Room vo) {
        RoomDAO roomDAO = new RoomDAOImpl();
        roomDAO.update(vo);
    }

    //@Override
    public Room get(Serializable id) {
        RoomDAO roomDAO = new RoomDAOImpl();
        return roomDAO.get(id);
    }

    //@Override
    public Map<String, Object> list(Map<String, Object> params) {
        RoomDAO roomDAO = new RoomDAOImpl();
        return roomDAO.list(params);
    }
}
